package com.mercury.ec.module.air.controller.admin.order.vo.orderroute;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mercury.ec.framework.excel.core.annotations.DictFormat;
import com.mercury.ec.framework.excel.core.convert.DictConvert;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

import static com.mercury.ec.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;

@Schema(description = "管理后台 - 机票订单行程 Response VO")
@Data
@ExcelIgnoreUnannotated
public class AirOrderRouteRespVO {

    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "18703")
    @ExcelProperty("id")
    private Long id;

    @Schema(description = "订单id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29387")
    @ExcelProperty("订单id")
    private Long orderId;

    @Schema(description = "序号", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("序号")
    private Integer serialNo;

    @Schema(description = "原行程id", example = "9870")
    @ExcelProperty("原行程id")
    private Long originOrderRouteId;

    @Schema(description = "航司代码")
    @ExcelProperty("航司代码")
    private String airlineNo;

    @Schema(description = "承运航司代码")
    @ExcelProperty("承运航司代码")
    private String carrierAirlineNo;

    @Schema(description = "航班号")
    @ExcelProperty("航班号")
    private String flightNo;

    @Schema(description = "舱位")
    @ExcelProperty("舱位")
    private String cabin;

    @Schema(description = "出发机场三字码")
    @ExcelProperty("出发机场三字码")
    private String depart;

    @Schema(description = "抵达机场三字码")
    @ExcelProperty("抵达机场三字码")
    private String arrive;

    @Schema(description = "航班日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("航班日期")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate flightDate;

    @Schema(description = "抵达日期")
    @ExcelProperty("抵达日期")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate arriveDate;

    @Schema(description = "出发时间(HH:mm)")
    @ExcelProperty("出发时间")
    private String departTime;

    @Schema(description = "抵达时间(HH:mm)")
    @ExcelProperty("抵达时间")
    private String arriveTime;

    @Schema(description = "出发航站楼")
    @ExcelProperty("出发航站楼")
    private String departTerminal;

    @Schema(description = "抵达航站楼")
    @ExcelProperty("抵达航站楼")
    private String arriveTerminal;

    @Schema(description = "机型")
    @ExcelProperty("机型")
    private String airModel;

    @Schema(description = "机型名称")
    @ExcelProperty("机型名称")
    private String airModelName;

    @Schema(description = "行李额")
    @ExcelProperty("行李额")
    private String baggageWeight;

    @Schema(description = "是否提供餐食")
    @ExcelProperty(value = "是否提供餐食", converter = DictConvert.class)
    @DictFormat("infra_boolean_string") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Boolean haveFood;

    @Schema(description = "餐食类型", example = "快餐")
    @ExcelProperty("餐食类型")
    private String foodType;

    @Schema(description = "是否经停")
    @ExcelProperty(value = "是否经停", converter = DictConvert.class)
    @DictFormat("infra_boolean_string") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Boolean stop;

    @Schema(description = "经停开始日期", example = "2022-01-01")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    @ExcelProperty("经停开始日期")
    private LocalDate stopStartDate;

    @Schema(description = "经停结束日期", example = "2022-01-01")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    @ExcelProperty("经停结束日期")
    private LocalDate stopEndDate;

    @Schema(description = "经停开始时间", example = "08:00")
    @ExcelProperty("经停开始时间")
    private String stopStartTime;

    @Schema(description = "经停结束时间", example = "18:00")
    @ExcelProperty("经停结束时间")
    private String stopEndTime;

    @Schema(description = "经停机场三字码", example = "SHA")
    @ExcelProperty("经停机场三字码")
    private String stopAirportNo;

    @Schema(description = "经停航站楼", example = "T1")
    @ExcelProperty("经停航站楼")
    private String stopTerminal;

    @Schema(description = "是否共享航班")
    @ExcelProperty(value = "是否共享航班", converter = DictConvert.class)
    @DictFormat("infra_boolean_string") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Boolean share;

    @Schema(description = "是否通程航班")
    @ExcelProperty(value = "是否通程航班", converter = DictConvert.class)
    @DictFormat("infra_boolean_string") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Boolean through;

    @Schema(description = "准点率")
    @ExcelProperty("准点率")
    private BigDecimal punctualityRate;

    @Schema(description = "飞行距离")
    @ExcelProperty("飞行距离")
    private Integer distance;

    @Schema(description = "飞行天数", example = "1")
    @ExcelProperty("飞行天数")
    private Integer flightDays;

    @Schema(description = "飞行时间")
    @ExcelProperty("飞行时间")
    private String flightTimes;

    @Schema(description = "编码航段状态")
    @ExcelProperty("编码航段状态")
    private String routeStatus;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;
}
